/*

    thermcap the thermal data collector program.
    thermcap collects CPU heating data and stores it in a csv and svg-graphic file
    Copyright (C) 2011  Giovanni Santostefano

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef _QUEUE_
#define _QUEUE_

#include <stdlib.h>

typedef int QITEM;

struct b_queue_item
{
	QITEM cput; /*cpu temperature*/
	struct b_queue_item *next;
	struct b_queue_item *prev;
};

/*a basic FIFO queue implementation*/
struct b_queue 
{
	struct b_queue_item *head; /*head used for extracting the first item*/
	struct b_queue_item *tail; /*tail used for create a new item*/
};

/*initialize the b_queue*/
struct b_queue* b_queue_init();

/*destroy the b_queue*/
void b_queue_free(struct b_queue *bq);

/*add an element at the end of the queue*/
void b_queue_addelement(struct b_queue *bq, QITEM element);

/*remove an element at the head of the queue*/
void b_queue_delelement(struct b_queue *bq);

/*get the head of the queue*/
QITEM b_queue_gethead(struct b_queue *bq);

#endif
